<template>
	<div class="indexListBox fc-fff padding-all-m">
		<listItem v-for="item in list" :item="item" :key="item.id"></listItem>
		<van-loading type="spinner" color="#75caff" v-if="load.loading=='loading'">加载中...</van-loading>
		<van-divider dashed v-if="load.loading=='noMore'"><span :style="{fontSize:fontSize==1?'13px':'16px'}">加载完毕</span></van-divider>
		<!-- <van-empty description="暂无该政策" v-if="load.loading=='noData'"/> -->
		<van-empty
		  class="custom-image"
		  image="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-767674fd-0f0e-4801-90e6-bef27c2e36df/48b46635-42be-4290-95f3-e27237461035.png"
		  description="暂无数据"
		  v-if="load.loading=='noData'"
		/>

	</div>
</template>

<script>
	import listItem from '@/components/listItem/ListItemNews.vue'
	// import { myMixins } from "@/assets/js/mixins.js";
	export default {
		components: {listItem},
		// mixins: [myMixins],
		data () {
		  return {
		    fontSize:localStorage.getItem('fontSize') || 1
		  }
		},
		props:{
			list:{
				type:Array,
				default(){
					return []
				}
			},
			load:{
				type:Object,
				default(){
					return {
						loading:'loading'
					}
				}
			}
		},
		watch:{
			load(newVal){
			}
		},
		mounted() {
			// console.log('components_load',this.load)
			// console.log('components_list',this.list)
			// console.log('components_list——len',this.list.length)
			// this.bus.$on('refreshList',(load)=>{
			// 	console.log('======refreshList=====',load)
			// })
		},
		// beforeDestroy() {
		// 	console.log("off refreshList")
		// 	this.bus.$off('refreshList')
		// },
		methods:{
			toDetailPage(item) {
				this.bus.$emit('refreshDetail',item)
			}
		}
	}
</script>

<style lang="scss">
	.indexListBox{
		.van-divider{
			color: #75caff;
		}
		.van-loading{
			text-align: center;
			// padding-top: 20px;
			// margin-top: 20px;
		}
		.van-empty{
			.van-empty__description{
				color: #75caff;
			}
		}
		
	}
	.custom-image {
		.van-empty__image {
		    width: 150px;
		    height: 107px;
			opacity: 0.5;
		}
	}
</style>
